﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SignUpDeal.aspx.cs" Inherits="E.Web.Teacher.internals.classes.SignUpDeal" %>
<%@ Import Namespace="E.Model" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>班级列表</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
     <link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
    <link rel="stylesheet" href="/css/t_main.css" type="text/css" media="all" />
    <link href="/js/jquery-window-5.03/css/jquery.window.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.8.21/themes/base/jquery-ui.css"
        type="text/css" media="all" />
    <link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css"
        type="text/css" media="all" />
         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
    <script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js" type="text/javascript"></script>
    <script src="http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.2.js"
        type="text/javascript"></script>
    <script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/minified/i18n/jquery-ui-i18n.min.js"
        type="text/javascript"></script>
    <script type="text/javascript" src="/js/Common.js"></script>
    <script type="text/javascript" src="/js/course.js"></script>
    <script type="text/javascript" src="/js/ajax.js"></script>
    <!--<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/js/ui/jquery.ui.core.js"></script>
    <script type="text/javascript" src="/js/ui/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="/js/ui/jquery.ui.mouse.js"></script>
    <script type="text/javascript" src="/js/ui/jquery.ui.button.js"></script>
    <script type="text/javascript" src="/js/ui/jquery.ui.draggable.js"></script>
    <script type="text/javascript" src="/js/ui/jquery.ui.position.js"></script>
    <script type="text/javascript" src="/js/ui/jquery.ui.resizable.js"></script>
    <script type="text/javascript" src="/js/ui/jquery.ui.dialog.js"></script>
    <script type="text/javascript" src="/js/ui/jquery.effects.core.js"></script>-->
    <script type="text/javascript" src="/js/jquery-window-5.03/jquery.window.js"> </script>
    <link href="/js/jquery-window-5.03/css/jquery.window.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="/css/t_main.css" type="text/css" media="all" />
    <script type="text/javascript" src="/js/jquery-window-5.03/jquery.window.min.js"> </script>
    <style type="text/css">
        a
        {
            color: #333;
            text-decoration: none;
            font-size: 10pt;
            cursor: pointer;
        }
        a:hover
        {
            color: #CC3300;
            text-decoration: underline;
            font-size: 10pt;
        }
        #ui-datepicker-div
        {
            z-index: 9999999 !important;
        }
    </style>

  <style type="text/css">
    .d_r_i{ float:left; width:75px; }	/*ID*/
    .d_r_cd{ float:left; width:150px; }	/*班级编号*/
    .d_r_e{ float:left; width:200px; }	/*课程*/
    .d_r_c{ float:left; width:150px; }	/*项目名称*/
    .d_r_o{ float:left; width:75px; }	/*操作*/
  </style>
   <script type="text/javascript">
       var windowObj;
       function Permit(userIDs, projectID,courseID, classCode) {
           var selectProject = projectID;
           var url = "/tools/ajax.aspx?t=getUserInfoByUserID&studentIds=" + userIDs;
           var data = "&studentIds12=" + userIDs;
           $("#projectID").attr("value", projectID);
           $("#classCode").attr("value", classCode);
           $("#courseID").attr("value", courseID);
           $.ajax({
               url: url,
               data: data,
               aync: true,
               datatype: "text",
               type: "post",
               async: true,
               success: function (jsondata) {
                   openStudentListWindow(jsondata);
               }
           });
       }
       
       function openStudentListWindow(jsondata) {
           var searchResult = $("<div id='searchResult'></div>");
           var table = $("<table id='tableSearchResult'></table>");
           table.appendTo(searchResult);
           var eachStudent;
           for (var i = 0; i < jsondata.length; i++) {
               eachStudent = jsondata[i];
               $("<tr><td class='ContentCell'><input type='checkbox' name='studentId' value='" + eachStudent.ID + "'/></td><td class='ContentCell'>" + eachStudent.UserName + "</td></tr>").appendTo(table);
           }
                      var btnDiv = $("<div style='float:left;'></div>");
                      btnDiv.appendTo(searchResult);
                      $("<a id='btnAll' name='btnAll' onclick=\"selectAll('tableSearchResult');\">全选&nbsp;&nbsp;</a>").appendTo(btnDiv);
                      $("<a id='btnInverse' name='btnInverse' onclick=\"inverseAll('tableSearchResult');\">反选&nbsp;&nbsp;</a>").appendTo(btnDiv);
                      $("<a id='btnConfirm' name='btnConfirm' onclick=\"confirmStudentArrayId();\">确定</a>").appendTo(btnDiv);
           $.window({
               //modalOpacity: 0.5,
               title: "审核报名学生",
               content: searchResult, // load window_block2 html content
               draggable: true,
               resizable: true,
               minimizable: false,
               maximizable: false,
               showModal: true
           });
       }
       function confirmStudentArrayId() {
           
           var idArray = '';
           var allSelectControl = $("#tableSearchResult input[type='checkbox']");

           $.each(allSelectControl, function (n, value) {
               
               if (value.checked == true) {
                   idArray = idArray + value.value + ";";
               }
           });
           $("#studentIdArray").attr("value", idArray.substring(0, idArray.length - 1));
           document.getElementById("form1").action = "?act=h";
           document.getElementById("form1").submit();
       }
  </script>
</head>
<body>
  <form id="form1" action="?act=s" method="post">
    <div class="m_top"></div>
    <div class="block_2">
      <div style="width:650px; height:22px;">
        <div class="title">&nbsp;搜索条件</div>
      </div>
      <div class="spe_line_2"></div>
      <div style="width:650px; height:23px; margin-top:6px;">
        <div class="fl" style="line-height:23px;">班级编号：</div>
        <div class="fl"><input type="text" id="ClassCodeTxt" name="ClassCodeTxt" value="<%=classCode %>" /></div>
        <div class="fl" style="line-height:23px;">&nbsp;项目名称：</div>
        <div class="fl">
          <select id="ProjectSlt" name="ProjectSlt">
            <% if (authority == E.Enum.EnumTeacherAuthority.Admin) { %>            
            <option value="-1">请选择</option>
            <% } %>
            <% foreach (System.Collections.Generic.KeyValuePair<int, string> kvp in projectList) { %>
            <option value="<%=kvp.Key %>"><%=kvp.Value %></option>
            <% } %>
          </select>
        </div>
        <div class="fl" style="line-height:23px;">&nbsp;状态：</div>
        <div class="fl">
          <select id="DelFlagSlt" name="DelFlagSlt">
            <option value="-1">请选择</option>
            <option value="0">正常</option>
            <option value="1">已冻结</option>
          </select>
        </div>
      </div>
      <div style="width:650px; height:23px; margin-top:6px;">
        <div class="fl" style="line-height:23px;">课程名称：</div>
        <div class="fl">
          <select id="CourseSlt" name="CourseSlt">          
            <option value="-1">请选择</option>
            <% foreach (System.Collections.Generic.KeyValuePair<int, string> kvp in courseList) { %>
            <option value="<%=kvp.Key %>"><%=kvp.Value %></option>
            <% } %>
          </select>
        </div>
        <div class="fl"><input type="image" src="/images/btn/search.gif" style="width:54px; height:23px; margin-left:20px;" /></div>
      </div>
    </div>
    
    <div class="block_2" style="height:340px; display:table;">
      <div style="width:650px; height:22px;">
        <div class="title">&nbsp;搜索结果</div>
      </div>
      <div class="spe_line_2"></div>
      
      <% if (classList != null && classList.Count > 0) { %>
    
      <div id="datatable">
        <div class="data_rows" style="font-weight:bolder;">
          <div class="d_r_i">ID</div>
          <div class="d_r_cd">班级编号</div>
          <div class="d_r_e">课程</div>
          <div class="d_r_c">项目组</div>
          <div class="d_r_o">操作</div>
        </div>
        
         <% foreach (InternalClassModel model in classList) { %>
        <div class="data_rows">
          <div class="d_r_i"><%=model.ID%></div>
          <div class="d_r_cd"><%=model.ClassCode%></div>
          <div class="d_r_e"><%=model.CourseName%></div>
          <div class="d_r_c"><%=model.ProjectName%></div>
          <div class="d_r_o"><a id="hrefPermit" onclick="Permit('<%=model.UserIDArr %>',<%=model.ProjectID %>,<%=model.CourseID %>,'<%=model.ClassCode %>')">审核</a></div>
        </div>
      
         <% } %>
        
      </div>
      
      <div class="fr" style="margin:8px 0 0 0;"><%=mypager%></div>
      
      <%} %>
    </div>
    <input type="hidden" name="studentIdArray" id="studentIdArray" />
    <input type="hidden" name="projectID" id="projectID" />
    <input type="hidden" name="classCode" id="classCode" />
    <input type="hidden" name="courseID" id="courseID" />
  </form>
  
</body>
</html>
